<%--
  Created by IntelliJ IDEA.
  User: YanHilin
  Date: 2020/5/1
  Time: 10:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>我的订单</title>
    <base href="http://localhost:8080/onlineflower/">
    <%@ include file="/page/comment/head.jsp"%>
    <style type="text/css">
        #table{
            text-align: center;
            width: 90%;
            margin: 0 auto;
        }
        #headth th{
            text-align: center;
        }
    </style>
    <script src="static/js/jquery-3.4.1.js"></script>
</head>
<body>
<%@include file="/page/user/head_nav.jsp"%>
<div>
    <c:if test="${empty requestScope.myorders}">
        <h1>暂无订单</h1>
        <h3><a href="page/user/index.jsp">去逛逛</a></h3>
    </c:if>
    <c:if  test="${not empty requestScope.myorders}">
        <div style="text-align: center">
            <a href="orderItemServlet?action=userOrderItem&status=0">待发货</a>
            <a href="orderItemServlet?action=userOrderItem&status=1">待收货</a>
            <a href="orderItemServlet?action=userOrderItem&status=2">待评价</a>
            <a href="orderItemServlet?action=userOrderItem&status=3">已完成</a>
        </div>
        <table id="table" class="table table-striped">
            <thead id="thead">
            <tr id="headth">
                <th>序号</th>
                <th>订单号</th>
                <th>创建时间</th>
                <th>金额</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${requestScope.myorders}" var="iorder" varStatus="s">
                <tr>
                    <td>${s.count}</td>
                    <td>${iorder.orderid}</td>
                    <td>${iorder.createtime}</td>
                    <td>${iorder.price}</td>
                    <td><a href="orderServlet?action=showOrderDetail&orderid=${iorder.orderid}">查看详情</a></td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </c:if>
</div>
</body>
</html>
